home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / lib / gcc-lib / ppc-amigaos / 2.95.1 / sys-include / gl / tube.h < prev   
C/C++ Source or Header  |  2000-03-13  |  9KB  |  212 lines

  1. /* 
  2.  * tube.h
  3.  *
  4.  * FUNCTION:
  5.  * Tubing and Extrusion header file.
  6.  * This file provides protypes and defines for the extrusion 
  7.  * and tubing primitives.
  8.  *
  9.  * HISTORY:
  10.  * Linas Vepstas 1990, 1991
  11.  */
  12.  
  13. #ifndef __TUBE_H__
  14. #define __TUBE_H__
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20. /**
  21.  GLE API revision history:
  22.  
  23.  GLE_API_VERSION is updated to reflect GLE API changes (interface
  24.  changes, semantic changes, deletions, or additions).
  25.  
  26.  GLE_API_VERSION=228  GLUT 3.7 release of GLE.
  27. **/
  28. #ifndef GLE_API_VERSION  /* allow this to be overriden */
  29. #define GLE_API_VERSION                228
  30. #endif
  31.  
  32. /* some types */
  33. #define gleDouble double
  34. typedef gleDouble gleAffine[2][3];
  35.  
  36. /* ====================================================== */
  37.  
  38. /* defines for tubing join styles */
  39. #define TUBE_JN_RAW          0x1
  40. #define TUBE_JN_ANGLE        0x2
  41. #define TUBE_JN_CUT          0x3
  42. #define TUBE_JN_ROUND        0x4
  43. #define TUBE_JN_MASK         0xf    /* mask bits */
  44. #define TUBE_JN_CAP          0x10
  45.  
  46. /* determine how normal vectors are to be handled */
  47. #define TUBE_NORM_FACET      0x100
  48. #define TUBE_NORM_EDGE       0x200
  49. #define TUBE_NORM_PATH_EDGE  0x400 /* for spiral, lathe, helix primitives */
  50. #define TUBE_NORM_MASK       0xf00    /* mask bits */
  51.  
  52. /* closed or open countours */
  53. #define TUBE_CONTOUR_CLOSED     0x1000
  54.  
  55. #define GLE_TEXTURE_ENABLE      0x10000
  56. #define GLE_TEXTURE_STYLE_MASK  0xff
  57. #define GLE_TEXTURE_VERTEX_FLAT         1
  58. #define GLE_TEXTURE_NORMAL_FLAT         2
  59. #define GLE_TEXTURE_VERTEX_CYL          3
  60. #define GLE_TEXTURE_NORMAL_CYL          4
  61. #define GLE_TEXTURE_VERTEX_SPH          5
  62. #define GLE_TEXTURE_NORMAL_SPH          6
  63. #define GLE_TEXTURE_VERTEX_MODEL_FLAT   7
  64. #define GLE_TEXTURE_NORMAL_MODEL_FLAT   8
  65. #define GLE_TEXTURE_VERTEX_MODEL_CYL    9
  66. #define GLE_TEXTURE_NORMAL_MODEL_CYL    10
  67. #define GLE_TEXTURE_VERTEX_MODEL_SPH    11
  68. #define GLE_TEXTURE_NORMAL_MODEL_SPH    12
  69.  
  70. #ifdef GL_32
  71. /* HACK for GL 3.2 -- needed because no way to tell if lighting is on.  */
  72. #define TUBE_LIGHTING_ON        0x80000000
  73.  
  74. #define gleExtrusion            extrusion
  75. #define gleSetJoinStyle         setjoinstyle
  76. #define gleGetJoinStyle         getjoinstyle
  77. #define glePolyCone             polycone
  78. #define glePolyCylinder         polycylinder
  79. #define gleSuperExtrusion       super_extrusion
  80. #define gleTwistExtrusion       twist_extrusion
  81. #define gleSpiral               spiral
  82. #define gleLathe                lathe
  83. #define gleHelicoid             helicoid
  84. #define gleToroid               toroid
  85. #define gleScrew                screw
  86.  
  87. #endif /* GL_32 */
  88.  
  89. #if defined(__STORM__) && defined(__PPC__) && !defined(COMPILING_GLE)
  90. #include <stormprotos/gle_sprotos.h>
  91. #else
  92.  
  93. extern int gleGetJoinStyle (void);
  94. extern void gleSetJoinStyle (int style);        /* bitwise OR of flags */
  95. extern int gleGetNumSlices(void);
  96. extern void gleSetNumSlices(int slices);
  97.  
  98. /* draw polyclinder, specified as a polyline */
  99. extern void glePolyCylinder (int npoints,       /* num points in polyline */
  100.                    gleDouble point_array[][3],  /* polyline vertces */
  101.                    float color_array[][3],      /* colors at polyline verts */
  102.                    gleDouble radius);           /* radius of polycylinder */
  103.  
  104. /* draw polycone, specified as a polyline with radii */
  105. extern void glePolyCone (int npoints,    /* numpoints in poly-line */
  106.                    gleDouble point_array[][3],  /* polyline vertices */
  107.                    float color_array[][3],      /* colors at polyline verts */
  108.                    gleDouble radius_array[]); /* cone radii at polyline verts */
  109.  
  110. /* extrude arbitrary 2D contour along arbitrary 3D path */
  111. extern void gleExtrusion (int ncp,         /* number of contour points */
  112.                 gleDouble contour[][2],     /* 2D contour */
  113.                 gleDouble cont_normal[][2], /* 2D contour normals */
  114.                 gleDouble up[3],            /* up vector for contour */
  115.                 int npoints,            /* numpoints in poly-line */
  116.                 gleDouble point_array[][3], /* polyline vertices */
  117.                 float color_array[][3]); /* colors at polyline verts */
  118.  
  119. /* extrude 2D contour, specifying local rotations (twists) */
  120. extern void gleTwistExtrusion (int ncp,         /* number of contour points */
  121.                 gleDouble contour[][2],    /* 2D contour */
  122.                 gleDouble cont_normal[][2], /* 2D contour normals */
  123.                 gleDouble up[3],           /* up vector for contour */
  124.                 int npoints,           /* numpoints in poly-line */
  125.                 gleDouble point_array[][3],        /* polyline vertices */
  126.                 float color_array[][3],        /* color at polyline verts */
  127.                 gleDouble twist_array[]);   /* countour twists (in degrees) */
  128.  
  129. /* extrude 2D contour, specifying local affine tranformations */
  130. extern void gleSuperExtrusion (int ncp,  /* number of contour points */
  131.                 gleDouble contour[][2],    /* 2D contour */
  132.                 gleDouble cont_normal[][2], /* 2D contour normals */
  133.                 gleDouble up[3],           /* up vector for contour */
  134.                 int npoints,           /* numpoints in poly-line */
  135.                 gleDouble point_array[][3],        /* polyline vertices */
  136.                 float color_array[][3],        /* color at polyline verts */
  137.                 gleDouble xform_array[][2][3]);   /* 2D contour xforms */
  138.  
  139. /* spiral moves contour along helical path by parallel transport */
  140. extern void gleSpiral (int ncp,        /* number of contour points */
  141.              gleDouble contour[][2],    /* 2D contour */
  142.              gleDouble cont_normal[][2], /* 2D contour normals */
  143.              gleDouble up[3],           /* up vector for contour */
  144.              gleDouble startRadius,     /* spiral starts in x-y plane */
  145.              gleDouble drdTheta,        /* change in radius per revolution */
  146.              gleDouble startZ,          /* starting z value */
  147.              gleDouble dzdTheta,        /* change in Z per revolution */
  148.              gleDouble startXform[2][3], /* starting contour affine xform */
  149.              gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
  150.              gleDouble startTheta,      /* start angle in x-y plane */
  151.              gleDouble sweepTheta);     /* degrees to spiral around */
  152.  
  153. /* lathe moves contour along helical path by helically shearing 3D space */
  154. extern void gleLathe (int ncp,        /* number of contour points */
  155.              gleDouble contour[][2],    /* 2D contour */
  156.              gleDouble cont_normal[][2], /* 2D contour normals */
  157.              gleDouble up[3],           /* up vector for contour */
  158.              gleDouble startRadius,     /* spiral starts in x-y plane */
  159.              gleDouble drdTheta,        /* change in radius per revolution */
  160.              gleDouble startZ,          /* starting z value */
  161.              gleDouble dzdTheta,        /* change in Z per revolution */
  162.              gleDouble startXform[2][3], /* starting contour affine xform */
  163.              gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
  164.              gleDouble startTheta,      /* start angle in x-y plane */
  165.              gleDouble sweepTheta);     /* degrees to spiral around */
  166.  
  167. /* similar to spiral, except contour is a circle */
  168. extern void gleHelicoid (gleDouble rToroid, /* circle contour (torus) radius */
  169.              gleDouble startRadius,     /* spiral starts in x-y plane */
  170.              gleDouble drdTheta,        /* change in radius per revolution */
  171.              gleDouble startZ,          /* starting z value */
  172.              gleDouble dzdTheta,        /* change in Z per revolution */
  173.              gleDouble startXform[2][3], /* starting contour affine xform */
  174.              gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
  175.              gleDouble startTheta,      /* start angle in x-y plane */
  176.              gleDouble sweepTheta);     /* degrees to spiral around */
  177.  
  178. /* similar to lathe, except contour is a circle */
  179. extern void gleToroid (gleDouble rToroid, /* circle contour (torus) radius */
  180.              gleDouble startRadius,     /* spiral starts in x-y plane */
  181.              gleDouble drdTheta,        /* change in radius per revolution */
  182.              gleDouble startZ,          /* starting z value */
  183.              gleDouble dzdTheta,        /* change in Z per revolution */
  184.              gleDouble startXform[2][3], /* starting contour affine xform */
  185.              gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
  186.              gleDouble startTheta,      /* start angle in x-y plane */
  187.              gleDouble sweepTheta);     /* degrees to spiral around */
  188.  
  189. /* draws a screw shape */
  190. extern void gleScrew (int ncp,          /* number of contour points */
  191.              gleDouble contour[][2],    /* 2D contour */
  192.              gleDouble cont_normal[][2], /* 2D contour normals */
  193.              gleDouble up[3],           /* up vector for contour */
  194.              gleDouble startz,          /* start of segment */
  195.              gleDouble endz,            /* end of segment */
  196.              gleDouble twist);          /* number of rotations */
  197.  
  198. extern void gleTextureMode (int mode);
  199.  
  200. #if defined(__VBCC__) && (defined(GL_INLINE) || defined(__PPC__))
  201. #include <proto/gle.h>
  202. #endif
  203.  
  204. #endif
  205.  
  206. #ifdef __cplusplus
  207. }
  208.  
  209. #endif
  210. #endif /* __TUBE_H__ */
  211. /* ================== END OF FILE ======================= */
  212.